﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using IntelligentDecisioning.SharePoint.Logging;

namespace IntelligentDecisioning.SharePoint.Helpers
{
    public class IDSiteHelper:IDSharePointHelper
    {
        #region Constructor

        public IDSiteHelper(SPSite siteCollection, SPWeb targetWeb)
            : base(siteCollection, targetWeb, new NoLog())
        {

        }

        public IDSiteHelper(SPSite siteCollection, SPWeb targetWeb, ILog log)
            : base(siteCollection, targetWeb, log)
        {

        }


        #endregion

        #region Methods

        #region Add a WIKI site

        /// <summary>
        /// Adds a new wiki site to the target web
        /// </summary>
        public void AddWikiSubSite(string relativeUrl, String title, string description)
        {
            TargetWeb.Webs.Add(relativeUrl, title, description, 1033, SPWebTemplate.WebTemplateWIKI, false, false);
            TargetWeb.Update();
        }

        #endregion

        #region Add a Blog Site

        /// <summary>
        /// Adds a new blog subsite to the target web
        /// </summary>
        public void AddBlogSubSite(string relativeUrl, String title, string description)
        {
            TargetWeb.Webs.Add(relativeUrl, title, description, 1033, SPWebTemplate.WebTemplateBLOG, false, false);
        }

        #endregion

        #endregion
    }
}
